function toggleBar()
{
	if(document.getElementById("bar_container").style.display=="block" || document.getElementById("bar_container").style.display=="")
	{
		document.getElementById("bar_container").style.display = "none";
		setCookie("floatbottomboxdisplay",1,null);
	}
	else
	{
		document.getElementById("bar_container").style.display = "block";
		setCookie("floatbottomboxdisplay",2,null);
	}
}
var floatbottomboxCurrent = 0;
function initFloatBox()
{
	var floatbottomboxdisplay = getCookie("floatbottomboxdisplay");
	if(!floatbottomboxdisplay) statex = "style='display:block'";
	else { if(floatbottomboxdisplay=="2") statex = "style='display:block'"; else statex = "style='display:none'"; }

	//var ax = "<div id='bar_float'><div id='bar_top'><a href='javascript:;' onclick='javascript:toggleBar();'><span>Đóng / Mở</span></a></div><div id='bar_container' "+statex+"><span><object width='250' height='170' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'><param value='http://forum.vietyo.com/yomedia/muvietlong_250x125.swf' name='movie'/><param value='high' name='quality'/><param value='always' name='AllowScriptAccess'/><param value='opaque' name='wmode'/><param value='autostart=false' name='FlashVars'/><embed src='http://forum.vietyo.com/yomedia/muvietlong_250x125.swf' width='250' height='170' pluginspage='http://www.macromedia.com/go/getflashplayer' allowscriptaccess='always' type='application/x-shockwave-flash' flashvars='autostart=false' wmode='opaque' /></object></span></div></div>";
	var ax = "<div id='bar_float'><div id='bar_top'><a href='javascript:;' onclick='javascript:toggleBar();'><span>Đóng / Mở</span></a></div><div id='bar_container' "+statex+"><span><a href='http://m88.in' target='_blank'><img src=' http://fs1.cyworld.vn/data3/2011/12/06/187/thumb_flex-1323179187110526_file.gif' width='450' height='90' /></a></span></div></div>";
	document.writeln(ax);

	
	document.writeln("<style> * html div#bar_float {position: absolute; overflow:hidden; top:expression(eval(document.compatMode && document.compatMode=='CSS1Compat') ? documentElement.scrollTop +(documentElement.clientHeight-this.clientHeight) : document.body.scrollTop +(document.body.clientHeight-this.clientHeight));} #bar_float {bottom:0;right:0px;width:450px;position:fixed;z-index:9999;} #bar_top {text-align:right;width:445px;height:22px;cursor:hand;} #bar_top a span {display:block;height:22px;color:#fff;} #bar_top a {text-decoration:none} #bar_container {width:450px;height:90px;} #bar_container a span {display:block;width:450px;height:90px;} #bar_container a {text-decoration:none}</style>");	
	//document.getElementById("bar_container").style.display="block";
	floatbottomboxCurrent=0;
}
function floatbottomboxNext()
{
	if(floatbottomboxCurrent<"2")
	{
		document.getElementById("floatbottombox_ctn_"+floatbottomboxCurrent).style.display="none";
		document.getElementById("floatbottombox_ctn_"+(floatbottomboxCurrent+1)).style.display="block";
		floatbottomboxCurrent = floatbottomboxCurrent+1;
	} else {
		document.getElementById("floatbottombox_ctn_2").style.display="none";
		document.getElementById("floatbottombox_ctn_0").style.display="block";
		floatbottomboxCurrent = 0;
	}
}
function setCookie(c_name,value,expiredays)

{



var today = new Date();

today.setTime( today.getTime() );

var expires = 30 * 1000 * 60;

var expires_date = new Date( today.getTime() + (expires) );	



	document.cookie = c_name+"="+value+";expires=" + expires_date.toGMTString();

	/*

	var exdate=new Date();

	exdate.setDate(exdate.getDate()+expiredays);

	document.cookie=c_name+ "=" +escape(value)+((expiredays==null) ? "" : ";expires="+expires_date.toGMTString());

	*/

}

function getCookie(c_name)
{
	if (document.cookie.length>0)
	  {
	  c_start=document.cookie.indexOf(c_name + "=");
	  if (c_start!=-1)
	    {
	    c_start=c_start + c_name.length+1;
	    c_end=document.cookie.indexOf(";",c_start);
	    if (c_end==-1) c_end=document.cookie.length;
	    return unescape(document.cookie.substring(c_start,c_end));
	    }
	  }
	return "";
}
initFloatBox();

